//
//  main.c
//  不同元素的个数
//
//  Created by apple on 2017/1/6.
//  Copyright © 2017年 apple. All rights reserved.
//

#include <stdio.h>
void selection(int a[],int n);
int main(){
    int n,i,m,j,x=0,h,k;
    int a[100];
    scanf("%d",&n);
    for (h=0; h<n; h++) {
        scanf("%d",&m);
        for (j=0;j<m ;j++ ) {
            scanf("%d",&a[j]);
        }
        selection(a,m);
        for (i=0; i<m-1; i++){
            for (k=i+1; k<m; k++)
                if (a[i]==a[k])
                    x++;
        }
        printf("%d\n",(m-x));
        x=0;
    }
    
}


void selection(int a[],int m){
    int i,j,index,tem;
    for (i=0 ;i<m; i++) {
        index=i;
        for (j=i+1; j<m; j++) {
            if (a[j]<a[index])
                index=j;
            if (i!=index){
                tem=a[i];
                a[i]=a[index];
                a[index]=tem;}
        }
        
    }
    
}